<html>
 <head>
  <script type="text/javascript"
    src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
  <script>
    function print() {
        var f=$(".__CO_OUT");
        var v=f.val();
        var s='';

        if (v != '') v = v + "\n";

        if(arguments.length > 0) s = arguments[0];

        for(var i=1; i < arguments.length; i++) s = s + ' ' + arguments[i];

        f.val(v + s);
    }
  </script>
 </head>
 <body>
  <form>
   <textarea class="__CO_IN" wrap="logical" rows="20" cols="70"
             style="font-family: consolas, courier, monospace"></textarea>
   <textarea class="__CO_OUT" wrap="logical" rows="10" cols="70"
             readonly="readonly"
             style="font-family: consolas, courier, monospace"></textarea>
   <br />
   <input type="button" value="eval"
          onClick="print('=>', eval($('.__CO_IN').val()));" />
   <input type="button" value="clear code"
          onClick="$('.__CO_IN').val('');" />
   <input type="button" value="clear output"
          onClick="$('.__CO_OUT').val('');" />
   <input type="button" value="reset test div"
          onClick="$('.test').html('');" />
  </form>
  <h1>Special functions defined in this pseudo-REPL</h1>
  (jQuery is included) <br/>
  print - writes its arguments to the output textarea, separated by spaces.
  <h3>Attach all generated html elements to div with class test and they will appear below</h3>
  <div class="test"></div>
 </body>
</html>
